


var camelizeRE = /-(\w)/g;
var camelize =function(str) {
    return str.replace(camelizeRE, function(_, c) { return c ? c.toUpperCase() : ''; })
}
function baseWarn(msg) {
    console.error(("[Vue compiler]: " + msg));
}

var no = function(a, b, c) { return false; };

function makeAttrsMap(attrs) {

    var map = {};
    for (var i = 0, l = attrs.length; i < l; i++) {
        map[attrs[i].name] = attrs[i].value;
    }
    return map
}

function decodeAttr(value, shouldDecodeNewlines) {
    var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
    return value.replace(re, function(match) { return decodingMap[match]; })
}

function genAssignmentCode(
    value,  assignment
) {

    var res = parseModel(value);

    if (res.key === null) {
        return (value + "=" + assignment)
    } else {
        return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
    }
}
function makeMap(
    str,
    expectsLowerCase
) {

    var map = Object.create(null);
    var list = str.split(',');

    for (var i = 0; i < list.length; i++) {
        map[list[i]] = true;
    }

    return expectsLowerCase ?
        function (val) {
            return map[val.toLowerCase()];
        } :
        function (val) {
            return map[val];
        }
}
var isUnaryTag = makeMap(
    'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
    'link,meta,param,source,track,wbr'
);
function parseModel(val) {

    // Fix https://github.com/vuejs/vue/pull/7730
    // allow v-model="obj.val " (trailing whitespace)
    val = val.trim();
    len = val.length;
    // g：找不到 [ ,
    if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {

        index$1 = val.lastIndexOf('.');

        if (index$1 > -1) {
            return {
                exp: val.slice(0, index$1),
                key: '"' + val.slice(index$1 + 1) + '"'
            }

        } else {
            return {
                exp: val,
                key: null
            }
        }
    }

    str = val;
    index$1 = expressionPos = expressionEndPos = 0;

    while (!eof()) {

        chr = next();

        /* istanbul ignore if */
        if (isStringStart(chr)) {
            parseString(chr);

        } else if (chr === 0x5B) {
            parseBracket(chr);
        }
    }

    return {
        exp: val.slice(0, expressionPos),
        key: val.slice(expressionPos + 1, expressionEndPos)
    }
}

function next() {
    return str.charCodeAt(++index$1)
}

function eof() {
    return index$1 >= len
}

function isStringStart(chr) {
    return chr === 0x22 || chr === 0x27
}

function parseBracket(chr) {

    var inBracket = 1;
    expressionPos = index$1;

    while (!eof()) {

        chr = next();

        if (isStringStart(chr)) {
            parseString(chr);
            continue
        }

        if (chr === 0x5B) { inBracket++; }
        if (chr === 0x5D) { inBracket--; }

        if (inBracket === 0) {
            expressionEndPos = index$1;
            break
        }
    }
}

function parseString(chr) {

    var stringQuote = chr;

    while (!eof()) {
        chr = next();
        if (chr === stringQuote) {
            break
        }
    }
}

function extend(to, _from) {
    for (var key in _from) {
        to[key] = _from[key];
    }
    return to
}